package net.seehealth.healthpad.application.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;

public class MedicalReportAbnormalAdapter extends BaseAdapter {
	
	/** 菜单项内容*/
	private List<String> mValues;

	/** 当前上下文 */
	private Context mContext;
	
	/**
	 * 构造方法
	 * @param context 当前上下文
	 * @param values 要显示的所有值
	 * 
	 */
	public MedicalReportAbnormalAdapter(Context context, List<String> values){
		mContext = context;
		mValues = values;
	}

	@Override
	public int getCount() {
		return mValues.size();
	}

	@Override
	public Object getItem(int position) {
		return mValues.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		if (convertView == null) {
			convertView = new Button(mContext);
		}
		
		((Button) convertView).setText(mValues.get(position));
		
		return convertView;
	}

}
